home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
forth_83.zoo
/
edwindow.scr
< prev
next >
Wrap
Text File
|
1992-04-07
|
18KB
|
1 lines
\\ *** EDWINDOW.SCR *** 14sep86we Dieses File enthält das Editorfenster. Es kann als Beispiel für die Programmierung eines eigenen Fensters benutzt werden. \ Window-Handling Loadscreen 30oct86we Onlyforth Gem also definitions 1 7 +thru \ VDI-Functions for window 24aug86we : bar ( x1 y1 x2 y2 -- ) ptsin 4 array! 1 function ! &11 2 0 VDI ; : swr_mode ( mode -- ) intin ! &32 0 1 VDI ; : sf_interior ( style -- ) intin ! &23 0 1 VDI ; : sf_style ( styleindex -- ) intin ! &24 0 1 VDI ; : sf_color ( color -- ) intin ! &25 0 1 VDI ; : sf_perimeter ( pervis -- ) intin ! &104 0 1 VDI ; : fbox ( x1 y1 x2 y2 -- ) 1 swr_mode 1 sf_interior 0 sf_color 0 sf_perimeter bar ; \ save and restore the screen 10sep86we ?head @ 1 ?head ! Create memMFDB2 7 , 0 , &640 , &400 , &40 , 0 , 1 , 0 , 0 , 0 , memMFDB2 scr>mem scr>mem2 ( Xleft Ytop Width Heigth -- ) memMFDB2 mem>scr mem2>scr ( Xleft Ytop Width Heigth -- ) : save_screen 0 0 cwidth &80 * cheight &25 * scr>mem2 ; : restore_screen 0 0 cwidth &80 * cheight &25 * mem2>scr ; \ Windowcomponents and Windowsize 30aug86we :name :move + :info + :uparrow + :dnarrow + :vslide + Constant wi_components : wi_x ( -- n ) dx cwidth * ; : wi_y ( -- n ) dy cheight * ; : wi_width ( -- n ) c/l cwidth * ; : wi_height ( -- n ) l/s cheight * ; : wi_size ( -- wx wy wwidth wheight ) 0 wi_components wi_x 1- wi_y 1- wi_width 2+ wi_height 2+ wind_calc intout 2+ 4@ ; \ Window's title and sliders 25sep86we Variable wi_handle : wi_string ( 0string function# -- ) swap >r wi_handle @ swap r> >absaddr swap 0 0 wind_set ; : wi_title ( 0string -- ) :wf_name wi_string ; : wi_status ( 0string -- ) :wf_info wi_string ; : vslide_size wi_handle @ :wf_vslize &1000 capacity / 0 0 0 wind_set ; : vslide ( scr# -- ) wi_handle @ :wf_vslide rot &1000 capacity dup 1- IF 1- THEN */ 0 0 0 wind_set ; \ Draw window on screen 30aug86we : small_big ( -- sx sy sw sh bx by bw bh ) little 4@ wi_size ; : growbox small_big graf_growbox ; : shrinkbox small_big graf_shrinkbox ; : wi_clear wi_x 1- wi_y 1- over wi_width 1+ + over wi_height 1+ + fbox ; \ Open and close window 30aug86we : wi_open ( -- ) save_screen growbox wi_components wi_size wind_create dup wi_handle ! pad dup off dup wi_title wi_status wi_size wind_open wi_clear ; : wi_close ( -- ) wi_handle @ dup wind_close wind_delete shrinkbox restore_screen ;